package co.edu.unal.model;

import java.awt.Graphics;
import java.awt.Point;
import java.util.LinkedList;
import java.util.List;

import co.edu.unal.controller.App;

public class Dibujo {

	public Dibujo() {
		// 2. construction
		elements = new LinkedList<ObjetoGrafico>();
	}

	public void addElement(final ObjetoGrafico og) {
		elements.add(og);
		setModified(true);
		App.getInstance().repaint();
	}

	public void paint(Graphics g) {
		for (ObjetoGrafico og : elements) {
			og.paint(g);
		}
	}

	public boolean isModified() {
		return modified;
	}

	private void setModified(boolean modified) {
		this.modified = modified;
	}

	public void select(Point ptPressed, Point ptReleased) {
		for (ObjetoGrafico og : elements) {
			og.select(ptPressed, ptReleased);
		}
	}
	public void create(Point ptPressed, Point ptReleased){
		
	
	}
	

	// 1. declaration
	private List<ObjetoGrafico> elements;

	private boolean modified;
}
